<%@ page language="java" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/tags/faare" prefix="fa" %>

<HTML>
    <HEAD>
        <TITLE>Application menu and body</TITLE>
        <LINK rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/standard.css" />
    </HEAD>
    <BODY style="margin: 0; overflow: auto;" class="body_background">
        <!-- #### Horizontal Menu #### -->
        <TABLE cellpadding="0" cellspacing="0" border="0" width="100%" summary="Menu and body" class="body">
           <TR class="background">
              <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="45" border="0" alt=""></TD>
              <TD width="100%">
                 <TABLE cellpadding="0" cellspacing="0" width="100%" border="0" summary="Top menu icons">
                    <TR>
                       <fa:getMenu id="Hmenu" name="horizontal_menu_edition" />
                       <logic:iterate id="elt" name="Hmenu" property="elements">
                          <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                          <TD align="center">
                             <fa:showMenuElement name="elt" style="" basecontext="page"  />
                          </TD>
                       </logic:iterate>
                    </TR>
                 </TABLE>
              </TD>
              <TD align="center">
                 <html:link action="/showPerson" paramId="dn" paramName="user" paramProperty="dn" target="_self">
                    <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="commonName" />&nbsp;&nbsp;&nbsp;</NOBR>
                 </html:link>
                 <IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="8" border="0" alt=""><BR/>
                 <logic:empty name="user" property="profile">
                    <NOBR>&nbsp;&nbsp;&nbsp;Standard profile&nbsp;&nbsp;&nbsp;</NOBR>
                 </logic:empty>
                 <logic:notEmpty name="user" property="profile">
				    <logic:notEqual name="user" property="profile" value="User">
                    <html:link action="/showProfile" paramId="dn" paramName="user" paramProperty="dn" target="_parent">
                       <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="profile" />&nbsp;&nbsp;&nbsp;</NOBR>
                    </html:link>
					</logic:notEqual>
					<logic:equal name="user" property="profile" value="User">
                       <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="profile" />&nbsp;&nbsp;&nbsp;</NOBR>
					</logic:equal>
                 </logic:notEmpty>
              </TD>
           </TR>
           <TR style="background-image: url('<%=request.getContextPath()%>/images/top_background_01.gif');">
              <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" border="0" alt=""></TD>
              <TD width="100%" valign="middle"></TD>
              <TD width="100%" valign="middle"></TD>
           </TR>
        </TABLE>

        <!-- #### Body #### -->
        <TABLE cellpadding="0" cellspacing="20" border="0" align="center" width="100%" summary="Body" class="body">
            <TR><TD valign="top" height="450" width="100%" align="center">
                    <TABLE cellpadding="0" cellspacing="0" border="0" summary="Body" class="body" align="center" width="100%" >
                        <TR><TD valign="bottom">
						       <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/top_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD align="center" class="background" width="100%" rowspan="3">&nbsp;&nbsp;<B>Personal&nbsp;Info</B>&nbsp;&nbsp;</TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                    <TR><TD class="background"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" alt=""></TD>
                                        <TD class="background"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                            <TD valign="bottom">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/top_left_unselected.gif" width="6" height="6" alt=""></TD>
                                        <TD align="center" class="unselected_tab" width="100%" rowspan="3">
										&nbsp;&nbsp;<B><html:link action="/showPersonApplication" target="_self">Application</html:link></B>&nbsp;&nbsp;</TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_unselected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                    <TR><TD class="unselected_tab"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" alt=""></TD>
                                        <TD class="unselected_tab"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                            <TD width="100%">&nbsp;</TD>
                        </TR>
                        <TR><TD colspan="3">
						      <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD colspan="2" class="background" width="100%"><IMG src="./images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                        <TR><TD colspan="3" class="background">
                                <DIV style="margin: 15;">
                                    <TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
                                        <TR>
										     <TD width="60" rowspan="2">
											    <IMG src="ImageDispatcher?dn=<bean:write name='currentEntry' property='dn'/>&attname=photo" border="0" height="50" title="Photo" alt="photo">
											 </TD>
                                            <TD class="name">
											   <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="currentEntry" property="commonName" />&nbsp;&nbsp;&nbsp;</NOBR>
											</TD>
                                        </TR>
                                        <TR>
										   <TD class="job_title">
										      <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="currentEntry" property="title" />&nbsp;-</NOBR>
										   <html:link action="/showDepartment" paramId="dn" paramName="currentEntry" paramProperty="department" target="_self">
										        <NOBR>&nbsp;<bean:write name="currentEntry" property="department" />&nbsp;</NOBR>
											</html:link>
										   </TD>
										</TR>
                                        <TR><TD colspan="2"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
                                        <TR><TD colspan="2" class="body">First&nbsp;Name&nbsp;:&nbsp;							  <logic:present name="currentEntry" property="givenName"><bean:write name="currentEntry" property="givenName" /></logic:present>
										   <logic:notPresent name="currentEntry" property="givenName">N/A</logic:notPresent>
                                        </TD></TR>
                                        <TR><TD colspan="2" class="body">Last&nbsp;Name&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="name"><bean:write name="currentEntry" property="name" /></logic:present>
										   <logic:notPresent name="currentEntry" property="name">N/A</logic:notPresent>
                                        </TD></TR>
                                        <TR><TD colspan="2" class="body">User&nbsp;ID&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="id"><bean:write name="currentEntry" property="id" /></logic:present>
										   <logic:notPresent name="currentEntry" property="id">N/A</logic:notPresent>
										</TR></TD>
                                        <TR><TD colspan="2" class="body">Manager&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="manager">
										   <logic:notEmpty name="currentEntry" property="manager">
                                             <logic:iterate id="manager" name="currentEntry" property="manager">
											 <logic:present name="manager" property="commonName">
										   <html:link action="/showPerson" paramId="dn" paramName="manager" paramProperty="dn" target="_self">
										        <NOBR>&nbsp;<bean:write name="manager" property="commonName" />&nbsp;</NOBR>
											</html:link>
											  </logic:present>
											  <logic:notPresent name="manager" property="commonName"><font style="TEXT-DECORATION: none; COLOR: #cc3300;">Invalid manager</font></logic:notPresent>
                                              </logic:iterate>
											</logic:notEmpty>
                                            <logic:empty name="currentEntry" property="manager">N/A</logic:empty>
                                            </logic:present>
										   <logic:notPresent name="currentEntry" property="manager">N/A</logic:notPresent>
                                        </TD></TR>
                                        <TR><TD colspan="2"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
                                        <TR><TD colspan="2" class="white_title">How to contact ?</TD></TR>
                                        <TR>
										   <TD colspan="2" class="body">T&eacute;l.&nbsp;:&nbsp;
   										   <logic:present name="currentEntry" property="phone"><bean:write name="currentEntry" property="phone" /></logic:present>
										   <logic:notPresent name="currentEntry" property="phone">N/A</logic:notPresent>
										   </TD>
										</TR>
                                        <TR>
										   <TD colspan="2" class="body">Fax.&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="fax"><bean:write name="currentEntry" property="fax" /></logic:present>
										   <logic:notPresent name="currentEntry" property="fax">N/A</logic:notPresent>

										   </TD>
										</TR>
                                        <TR>
										   <TD colspan="2" class="body">Email&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="mail"><A href="mailto:<bean:write name='currentEntry' property='mail' />"><bean:write name='currentEntry' property='mail' /></A></logic:present>
										   <logic:notPresent name="currentEntry" property="mail">N/A</logic:notPresent>
										   </TD>
										</TR>
                                        <TR><TD colspan="2"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
                                        <TR><TD colspan="2" class="white_title">Where to find ?</TD></TR>
                                        <TR>
										   <TD colspan="2" class="body">Site&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="site">
										   <html:link action="/showSite" paramId="dn" paramName="currentEntry" paramProperty="site" target="_self">
										        <NOBR>&nbsp;<bean:write name="currentEntry" property="site" />&nbsp;</NOBR>
											</html:link>
                                            </logic:present>
										   <logic:notPresent name="currentEntry" property="site">N/A</logic:notPresent>
										   </TD>
										</TR>
                                        <TR>
										   <TD colspan="2" class="body">Room&nbsp;:&nbsp;
										   <logic:present name="currentEntry" property="roomNumber"><bean:write name="currentEntry" property="roomNumber" /></logic:present>
										   <logic:notPresent name="currentEntry" property="roomNumber">N/A</logic:notPresent>
										   </TD>
										</TR>

                                        <TR><TD colspan="2"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
                                        <TR><TD colspan="2" class="white_title">Personal Comment</TD></TR>
            							<!-- MULTI : description -->
                                         <logic:present name="currentEntry" property="description">
                                         <logic:iterate id="desc" name="currentEntry" property="description">
                                         <TR>
                                              <TD colspan="2" class="body">
                                              		<NOBR><bean:write name="desc"/></NOBR>
                                              </TD>
                                          </TR>
                                          </logic:iterate>
                                          </logic:present>
                                          <logic:notPresent name="currentEntry" property="description">
                                          <TR><TD colspan="2" class="body">N/A</TD>
                                          </TR>
                                          </logic:notPresent>
                                        <TR><TD colspan="2"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
									</TABLE>
                                </DIV>
                            </TD>
                        </TR>
                        <TR><TD width="100%" colspan="3">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/bottom_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/bottom_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
				<!-- #### Vertical menu #### -->
                <TD valign="top" width="200">
                   <BR/>
                   <fa:getMenu id="Vmenu" name="vertical_menu_full" />
                   <logic:notEmpty name="Vmenu" property="elements">
                   <FIELDSET id="formulaire" style="width: 80%; border-color: blue; border-style: outset">
        		      <LEGEND>&nbsp;Choose option&nbsp;</LEGEND>
                      <TABLE cellpadding="0" cellspacing="0" width="100%" border="0" summary="Top menu icons" class="body">
                         <logic:iterate id="elt" name="Vmenu" property="elements">
                            <TR>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                               <TD align="left">
                                  <NOBR><fa:showMenuElement name="elt" style="" basecontext="page"  /></NOBR>
                               </TD>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="5" alt="" border="0"></TD>
                            </TR>
                         </logic:iterate>
                      </TABLE>
                   </FIELDSET>
                   </logic:notEmpty>
                </TD>
            </TR>
        </TABLE>
    </BODY>
</HTML>
